<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
?>
        <div class="address_bd mt10">
            <h4>新增收货地址</h4>
            <?php $this->registerCss('li.required label:before{content:"* ";color:red;}');?>
            <?php $form = ActiveForm::begin();?>
            <?php /** @var $address  */?>
            <ul>
            <?php
            $formStyle = [
                'options'=>['tag'=>'li'],
                'template'=> "{label}\n{input}\n{hint}\n{error}",
                'errorOptions'=>['tag'=>'div','style'=>'color:red'],
            ];?>

            <?=$form->field($address,'username',$formStyle)->textInput(['class'=>'txt',]);?>
                <li>
                    <label for=""><span>*</span>所在地区：</label>
                    <select name="Address[province_name]" id="cmbProvince">

                    </select>
                    <select name="Address[city_name]" id="cmbCity">

                    </select>
                    <select name="Address[area_name]" id="cmbArea">

                    </select>
                </li>
            <?=$form->field($address,'detail_address',$formStyle)->textInput(['class'=>'txt'])?>
            <?=$form->field($address,'mobilephone',$formStyle)->textInput(['class'=>'txt'])?>

                <li>
            <label>&nbsp;</label>
                <input class="check" name="Address[status]" value="1" type="checkbox">
                设为默认地址
            <p style="color:red"></p>
                </li>
                <li>
                    <label>&nbsp;</label>
                <?=Html::submitInput('保存',['class'=>'btn'])?>
                </li>
            </ul>
            <?php ActiveForm::end();?>

        </div>

<?=Html::jsFile('@web/jsAddress/jsAddress.js');?>
<script type="text/javascript">
    addressInit('cmbProvince', 'cmbCity', 'cmbArea', '陕西', '宝鸡市', '金台区');
</script>


